{_include admin_menu}

<div class="left_content">
	<legend>จัดการสมาชิก</legend>
	<div style="margin-top:20px;">
	<?php
	 	if(!empty($datauser)){
	 	?>
	 	<table class="table table-bordered">
	 		<thead>
				<tr>
					<td ><b><center>Username</center></b></td>
					<td ><b><center>Email</center></b></td>
					<td ><b><center>Status</center></b></td>
					<td ><center><b>Group</center></b></td>
					<td><b><center>Edit & Delete</center></b></td>
				</tr>
			</thead>
			<?php
	 		foreach($datauser as $value) {
	 	?>
	 	<tbody >
				<tr>
					<td><center><?php echo $value['username']; ?></center></td>
					<td><center><?php echo $value['email']; ?></center></td>
					<td><center><?php echo $value['status']; ?></center></td>
					<td><center><?php echo $value['group']; ?></center></td>
					<td class="span3" >
						<center>
             <?php if($value['status'] == 0){ ?>
							<a href="<?php echo base_url('admin/user/add/'.$value['id']); ?>" class="imageedit"><img src="<?php echo $imagepath;?>/edit.png"  /></a>
							&nbsp;<a href="<?php echo base_url('user/admin_delete/'.$value['id']."/"."0"); ?>" class="imageedit"><img src="<?php echo $imagepath;?>/x.png"  /></a>
            <?php }elseif($value['status'] == 1){ ?>

            <a href="<?php echo base_url('user/admin_delete/'.$value['id']."/1"); ?>"> Unlock </a>
            <?php } ?>
						</center>
					</td>
				</tr>
			</tbody>
			<?php
			} // End foreach
		?>
		</table>
		<?php
		}else{
			echo "Empty List";
		} // End if
		?>
	</div>
</div>
